package com.controllers;

import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.inject.Inject;
import javax.inject.Named;

import com.daos.GroupDao;
import com.model.Group;
import com.model.Role;

@Named
@ManagedBean
public class GroupController {

	private GroupDao groupDao;

	public GroupController() {
	}

	@Inject
	public GroupController(GroupDao groupDao) {
		this.groupDao = groupDao;
	}

	public List<Group> getGroups() {
		return groupDao.getGroups();
	}

	public void saveGroup(Group group) {
		groupDao.save(group);
	}

	public List<Role> getRolesByGroup(int id) {
		return groupDao.getRolesByGroup(id);
	}

	public Group getGroupById(int id) {
		return groupDao.getGroupById(id);
		
	}

}
